package com.frontop.system.modules.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.frontop.system.modules.sys.model.SysMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author YangJia
 * @since 2021-09-15
 */
@Mapper
public interface SysMenuMapper extends BaseMapper<SysMenu> {
    SysMenu getMenuInfoById(Integer id);

    /**
     * 查出父节点Id是否在当前子节点当中
     *
     * @param map
     * @return
     */
    Integer isParentInChild(Map<String, Integer> map);

    /**
     * 获取菜单所有子节点Id
     *
     * @param id
     * @return
     */
    List<Integer> getAllChildById(Integer id);

    List<SysMenu> selectMenuByOrg(Integer orgId);

    List<SysMenu> selectMenuByUserName(@Param("userName") String userName, @Param("type")Integer type);
}
